/*
 * 代号：凤凰
 * http://www.jphenix.org
 * 2022年8月24日
 * V4.0
 */
package com.jphenix.servlet.api.javax;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.jphenix.standard.docs.ClassInfo;
import com.jphenix.standard.servlet.api.IRequest;
import com.jphenix.standard.servlet.api.IRequestDispatcher;
import com.jphenix.standard.servlet.api.IResponse;

/**
 * 请求调度对象
 * 
 * 2022-09-04 重构了对接Tomcat9以及以前版本代码
 * 
 * @author MBG
 * 2022年8月24日
 */
@ClassInfo({"2022-09-04 21:58","请求调度对象"})
public class RequestDispatcherImpl implements IRequestDispatcher,RequestDispatcher {

	private RequestDispatcher kernel = null; // 核心类实例
	
	/**
	 * 构造函数
	 * @author MBG
	 */
	public RequestDispatcherImpl(RequestDispatcher rd) {
		super();
		this.kernel = rd;
	}

	/**
	 * 覆盖方法
	 */
	@Override
	public void forward(IRequest request, IResponse response) throws Exception {
		kernel.forward((ServletRequest)request,(ServletResponse)response);
	}

	/**
	 * 覆盖方法
	 */
	@Override
	public void include(IRequest request, IResponse response) throws Exception {
		kernel.include((ServletRequest)request,(ServletResponse)response);
	}
	
	/**
	 * 覆盖方法
	 */
	@Override
	public void forward(ServletRequest request, ServletResponse response) throws ServletException,IOException {
		kernel.forward((ServletRequest)request,(ServletResponse)response);
	}

	/**
	 * 覆盖方法
	 */
	@Override
	public void include(ServletRequest request, ServletResponse response) throws ServletException,IOException {
		kernel.include((ServletRequest)request,(ServletResponse)response);
	}
}
